home *** CD-ROM | disk | FTP | other *** search
/ MacHack 2000 / MacHack 2000.toast / pc / The Hacks / Genie / Projects / AEA / Source / Sources / Event Handlers / AEAHandlerOpenDoc.cc < prev    next >
Encoding:
C/C++ Source or Header  |  2000-06-24  |  1.1 KB  |  57 lines

  1. /*    ====================
  2.  *    AEAHandlerOpenDoc.cc
  3.  *    ====================
  4.  */
  5.  
  6. #include "AEADebugging.h"
  7.  
  8. // AEA
  9. #include "AEAHandler.hh"
  10. #include "AEAHandlerOpenDoc.hh"
  11. #include "AEADescAppleEvent.hh"
  12. #include "AEADescList.hh"
  13.  
  14.  
  15. AEAHandlerOpenDoc::AEAHandlerOpenDoc()
  16. : AEAHandler(kCoreEventClass, kAEOpenDocuments)
  17. {
  18.     MakeNoteToTouchParam(keyDirectObject);
  19. }
  20.  
  21. AEAHandlerOpenDoc::~AEAHandlerOpenDoc()
  22. {
  23. }
  24.  
  25. void
  26. AEAHandlerOpenDoc::HandleEventSelf(const AEADescAppleEvent &inAppleEvent, AEADescAppleEvent &outReply)
  27. {
  28.     OSErr err;
  29.     AEADescList docList;
  30.     long docCount, index;
  31.     AEKeyword keyword;
  32.     DescType actualType;
  33.     FSSpec fss;
  34.     Size actualSize;
  35.     
  36.     inAppleEvent.GetParameter(keyDirectObject, typeAEList, docList.Ref());
  37.     
  38.     docCount = docList.CountItems();
  39.     
  40.     for (index = 1; index <= docCount; index++) {
  41.         err = ::AEGetNthPtr(&docList.Ref(), index, typeFSS, &keyword, &actualType, 
  42.             &fss, sizeof fss, &actualSize);
  43.         if (err) {
  44.             DebugBeep();
  45.             continue; // We should report this
  46.         }
  47.         
  48.         DoOpenDoc(fss);
  49.     }
  50.     NotifyAppOpenDocEvent();
  51. }
  52.  
  53. void
  54. AEAHandlerOpenDoc::DoOpenDoc(FSSpec &inFSS)
  55. {
  56. }
  57.